package unit8.part4;

import javax.swing.*;

public class JOptionPaneTest {
    public static void main(String[] args) {
        // 提醒对话框
        JOptionPane.showMessageDialog(null, "注意天气", "提醒", JOptionPane.PLAIN_MESSAGE);

        // 是否对话框
        int r = JOptionPane.showConfirmDialog(null, "是否通关？", "是否", JOptionPane.YES_NO_OPTION);
        System.out.println(r);// 是为0，否为1

        // 问题对话框
        String s = JOptionPane.showInputDialog(null, "请输入：", "问题", JOptionPane.QUESTION_MESSAGE);
        System.out.println(s);
    }
}
